package com.jnu.hc.jnuhcusercms.controller;

import com.jnu.hc.jnuhcusercms.domain.Orders;
import com.jnu.hc.jnuhcusercms.domain.Users;
import com.jnu.hc.jnuhcusercms.dto.ResponseObject;
import com.jnu.hc.jnuhcusercms.mapper.OverallresultMapper;
import com.jnu.hc.jnuhcusercms.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ReportController {

    @Autowired
    ReportService reportService;

    @Autowired
    OverallresultMapper overallresultMapper;
    @RequestMapping("/dreport")
    public ResponseObject dreport(@RequestBody Orders orders){

        return reportService.dreport(orders.getOrderId());
    }

    @RequestMapping("/overallr")
    public ResponseObject overallr(@RequestBody Orders orders){
        return new ResponseObject(200,"成功",overallresultMapper.selectByOrderId(orders.getOrderId()));
    }
}
